/*
 * @description: 权限
 * @Author: Islands
 * @Date: 2024-06-24 11:29:10
 * @LastEditTime: 2024-06-24 18:42:11
 */
import { $t } from '@/plugins/i18n/index';
import { computed } from 'vue';
import { IFormConstant, ITableConstant, IDetailsConstant } from '@/api/types/index.d'

export const searchConstants = computed(() => {
    return [
        { mode: 'input', label: $t(`outside.menu.menuName`), placeholder: $t(`outside.menu.menuName`, { prefix: $t(`placeholder.enter`) }), prop: 'name', clearable: true, width: '180px' },
        {
            mode: 'outside.select',
            label: $t(`state`),
            prop: 'enabled',
            options: [
                { label: '启用', value: 1 },
                { label: '禁用', value: 0 }
            ],
            clearable: true,
            width: '140px'
        }
    ] as Array<IFormConstant>;
});
export const saveOrUpdateConstants = computed(() => {
    return [
        { mode: 'input', span: 12, label: $t(`outside.menu.menuName`), placeholder: $t(`outside.menu.menuName`, { prefix: $t(`placeholder.enter`) }), prop: 'name', clearable: true },

    ] as Array<IFormConstant>;
})

export const tableConstants = computed(() => {
    return [
        { mode: 'index', label: 'id', type: 'selection', prop: 'id', show: true },
        { mode: 'column', label: $t(`outside.menu.menuName`), prop: 'title', show: true },
        { mode: 'icon', label: $t(`outside.menu.icon`), prop: 'icon', show: true },
        { mode: 'column', label: $t(`outside.menu.path`), prop: 'path', show: true },
        { mode: 'column', label: $t(`outside.menu.redirect`), prop: 'redirect', show: true },
        { mode: 'column', label: $t(`outside.menu.component`), prop: 'component', show: true },
        { mode: 'state', label: $t(`outside.state`), prop: 'enabled', show: true },
        { mode: 'is', label: $t(`outside.menu.hideMenu`), prop: 'hide', show: true }
    ] as Array<ITableConstant>;
});
export const detailsConstants = computed(() => {
    return [
        { mode: 'normal', label: $t(`outside.menu.menuName`), prop: 'title' },
        { mode: 'normal', label: $t(`outside.menu.icon`), prop: 'icon' },
        { mode: 'normal', label: $t(`outside.menu.path`), prop: 'path' },
        { mode: 'normal', label: $t(`outside.menu.redirect`), prop: 'redirect' },
        { mode: 'normal', label: $t(`outside.menu.component`), prop: 'component' },
        { mode: 'normal', label: $t(`outside.state`), prop: 'enabled' },
        { mode: 'normal', label: $t(`outside.menu.hideMenu`), prop: 'hide' }
    ] as Array<IDetailsConstant>;
});


